<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/sys/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加巡查项目信息</title>
<%@ include file="/WEB-INF/sys/include/css.jsp"%>
<link href="${path}/res/js/webuploader/webuploader.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form" action="${path}/inspection/item/save.json" method="post">
<div class="form">
	<div class="title">添加巡查项目信息</div>
	<div class="group">
		<div class="label">*项目名称:</div>
		<div class="item"><input type="text" name="itemName" id="itemName" maxlength="20" /></div>
	</div>
	<div class="group">
		<div class="label">巡查园区:</div>
		<div class="item">
			<input type="text" id="parkName" name="parkName" />
			<input type="hidden" name="parkid" id="parkid" />
		</div>
		<div class="item" id="parkNameTip"></div>
	</div>
	<div class="group">
		<div class="label">项目简介:</div>
		<div class="item"><textarea id="remark" name="remark"></textarea></div>
	</div>
	<div class="group">
		<div class="label">完成者:</div>
		<div class="item"><input type="text" name="finishBy" id="finishBy" maxlength="20" /></div>
	</div>
	<div class="group">
		<div class="label">完成时间:</div>
		<div class="item"><input type="text" name="finishTime" id="finishTime" ltype="date" maxlength="20" /></div>
	</div>
	<div class="group">
		<div class="label">反馈结果:</div>
		<div class="item"><textarea id="result" name="result"></textarea></div>
	</div>
	<div class="group">
		<div class="label">反馈附件:</div>
		<div class="item"><div id="itemAttachments" class="myuploader"></div></div>
	</div>
	<div class="buttons">
		<button class="highlight" id="submit1" type="button">确定</button>
		<button type="button" id="cancel1">取消</button>
		<input type="hidden" id="taskId" name="taskId" value="${taskId}" />
	</div>
	
</div>
</form>
<%@ include file="/WEB-INF/sys/include/script.jsp" %>
<script src="${path}/res/js/webuploader/webuploader.min.js" type="text/javascript"></script>
<script src="${path}/res/js/webuploader/myUploader.js" type="text/javascript"></script>
<script type="text/javascript">
var attachmentsmyuploader;
$(function() {
	attachmentsmyuploader = $("#itemAttachments").myUploader({
		uploadDir: "inspection_attachment",
		type: "attachment",
		canEditDesc: true
	});
	createSelect("parkName", "parkid", {
		valueField:'parkid', textField: 'parkName',
		url:'${path}/inspection/item/getParkData.json'
	});
	$("#form").ligerForm({inputWidth: 300});
	
	verifyForm("form", {}, function(){
		$("#form").ajaxForm(function(data){
			UiUtil.isSuccess(data, "添加巡查项目信息成功", function(){
				UiUtil.closeForm(true);
			});
		});
	});
	
	$("#submit1").click(function(){
		UiUtil.lockButton('submit1');
		if(!attachmentsmyuploader.isDone()){
			UiUtil.unlockButton('submit1');
			return
		}
		$("#form").submit();
	});

	$("#cancel1").click(function(){
		UiUtil.closeForm();
	});
	
});
</script>
</body>
</html>